import java.util.*;

class person{
    private String name;
    private int age;

    public person() {

    }

    public person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public person(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    private void eat(){
        System.out.println("吃饭！");
    }

    public void show(){
        System.out.println(name+" "+age);
    }

    @Override
    public String toString(){
        return "数据是：{"+"name="+name+'\''+",age="+age+'}';
    }
}

public class test_11_10_0_1 {

    public static void main(String[] args) {
        person p1=new person("张三",20);
        p1.setName("李四");
        System.out.println(p1.getName());
        p1.show();

//        p1.name="张三";
//        p1.eat();
//        //error,private权限后无法访问！！！
    }

//    public static void main(String[] args) {
//        person p=new person("张三",30);
//        System.out.println(p);
//
//        p.show();
//    }

}


